package com.your.netty.sample.core;

import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.ApplicationContext;

public class Application {
	public static ApplicationContext ctx = null;
	public static Properties properties = null;
	public static ExecutorService cachedThreadPool = Executors.newCachedThreadPool();

	public static DefaultListableBeanFactory getBeanFactory() {
		if (!DefaultListableBeanFactory.class.isAssignableFrom(ctx.getAutowireCapableBeanFactory().getClass())) {
			throw new IllegalArgumentException("BeanFactory must be DefaultListableBeanFactory type");
		}
		return (DefaultListableBeanFactory) ctx.getAutowireCapableBeanFactory();
	}
}
